{% extends 'base.html' %}

{% block title %}添加组{% endblock %}

{% block content %}
<form class="layui-form" action="" method="post">
	<div class="layui-container">
	  <div class="layui-row">
	    <div class="layui-col-md4">
			  <div class="layui-form-item">
			    <label class="layui-form-label">组名</label>
			    <div class="layui-input-block">
			      <input type="text" name="name" required  lay-verify="required" placeholder="" value="{{ name }}" autocomplete="off" class="layui-input">
				    {% csrf_token %}
			    </div>
			  </div>
	    </div>
		  <div class="layui-col-md8"></div>
	  </div>

	  <div class="layui-form-item layui-form-text">
	    <label class="layui-form-label">备注</label>
	    <div class="layui-input-block">
	      <textarea name="comment" placeholder="请输入内容" class="layui-textarea">{{ comment }}</textarea>
	    </div>
    </div>
		{% if error %}
		<div class="layui-row layui-col-space10">
      <div class="layui-col-md1">
	      <i class="layui-icon"></i>
      </div>
			<div class="layui-col-md4">
	      <i class="layui-icon" style="font-size: 30px; color: #FFB800;">&#xe69c;: {{ error }}</i>
			</div>
		</div>
		{% endif %}
	  <div class="layui-form-item">
	    <div class="layui-input-block">
	      <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
	      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
	    </div>
	  </div>
	</div>
</form>

<script>
//Demo
layui.use('form', function(){
  var form = layui.form;

  //监听提交
  form.on('submit(formDemo)', function(data){
{#    layer.msg(JSON.stringify(data.field));#}
    return true;
  });
});
</script>
{% endblock %}